<%@ taglib prefix="spring-tags" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="spring-form" uri="http://www.springframework.org/tags/form"%>
<%@ page
    import="org.jiscinvolve.astrodabis.mallow.model.api.Tag"
    import="org.jiscinvolve.astrodabis.mallow.model.api.Query"
    import="org.jiscinvolve.astrodabis.mallow.model.api.Result"
    import="org.jiscinvolve.astrodabis.mallow.model.api.Account"
    import="org.jiscinvolve.astrodabis.mallow.model.tap.TapTable"
    import="org.jiscinvolve.astrodabis.mallow.model.tap.TapService"
    import="org.jiscinvolve.astrodabis.mallow.control.ViewData"
    session="true"
%>
<%@ include file="/jsp/init.jsp" %>
<html>
    <head>
	    <title>AstroDAbis <%= user.name() %>&apos;s services</title>
        <link href='/astrodabis/css/page.css' rel='stylesheet' type='text/css'/>
    </head>
    <body>
        <%@ include file="/jsp/header.jsp" %>
        <div class='body'>
            <div class='left'>
                <%@ include file="/jsp/menu.jsp" %>
            </div>
            <div class='right'>
            </div>
            <div class='content'>
                <h2><%= user.name() %>&apos;s services</h2>
                <table>
                    <tr>
                        <th>Name</th>
                        <th>Description</th>
                    </tr>
                    <%
                    for (TapService service : user.services().select())
                        {
                        %>
                        <tr>
                            <td><a href='<%= data.path(service) %>'><%= service.name() %></a></td>
                            <td><%= service.text() %></td>
                        </tr>
                        <%
                        }
                    %>
                </table>
                <hr/>
                <%
                if ((actor != null) && (actor.equals(user)))
                    {
                    %>
                    <div>
                        <a href="<%= data.path("services/create") %>">Create a new service</a>
                    </div>
                    <%
                    }
                %>
            </div>
        </div>
        <%@ include file="/jsp/footer.jsp" %>
    </body>
</html>


